package shapewar.view.indvidul;

import android.graphics.Canvas;
import shapewar.engine.model.Wall;
import shapewar.engine.model.abst.Model;
import shapewar.engine.presenter.Presenter;
import shapewar.view.myview.MyView;
import shapewar.view.myview.PaintFilter;

public class WallView extends MyView{
	public WallView(Presenter pst, Model shape) {
		super(pst, shape);
		paint.setColor(((Wall)getModel()).color);
		paint.setAlpha(180);
		//paint.setMaskFilter(PaintFilter.getMaskFilter());
		//paint.setMaskFilter(PaintFilter.getLightFilter());
	}
	
	@Override
	protected void onDraw(Canvas canvas) {
		if(pst.ect.player!=null)
			if(pst.ect.player.wall==getModel()){
				if(((Wall)getModel()).tank_count>0)
					paint.setAlpha(100);
			}else{
				paint.setAlpha(180);
			}
		super.onDraw(canvas);
	}
}
